// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-11-7

#ifndef __NET_MANAGER_H_COMMON_SERVLIB__
#define __NET_MANAGER_H_COMMON_SERVLIB__

#pragma once

#include "net_socket.h"
#include "net_completionport.h"

namespace JoyServer
{

class CJoySocket;
class CJoySockData;

// manager for global socket datas.
class CJoySockMan
{
protected:
public:
    CJoyReleaseSockData     m_releaseSockData;
    CJoySockCompletionPort  m_completionPort;
public:
    CJoySockMan();
    virtual ~CJoySockMan();

    BOOL AcceptEx (
        IN SOCKET sListenSocket,
        IN SOCKET sAcceptSocket,
        IN PVOID lpOutputBuffer,
        IN DWORD dwReceiveDataLength,
        IN DWORD dwLocalAddressLength,
        IN DWORD dwRemoteAddressLength,
        OUT LPDWORD lpdwBytesReceived,
        IN LPOVERLAPPED lpOverlapped
        );
};

extern CJoySockMan g_sockMan;

} // namespace JoyServer

#endif  // __NET_MANAGER_H_COMMON_SERVLIB__